load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("//build:wabt_build.bzl", "wabt_config_h")

wabt_config_h(
    name = "config_h",
    out = "config.h",
    target_os = select({
        "@platforms//os:linux": "linux",
        "@platforms//os:windows": "windows",
        "//conditions:default": "",
    }),
    version = module_version(),
)

cc_library(
    name = "wabt",
    hdrs = glob([
        "*.def",
        "*.h",
        "interp/*.h",
    ]) + [":config_h"],
    strip_include_prefix = "/include",
    textual_hdrs = glob(["*.def"]),
    visibility = ["//:__subpackages__"],
)
